$OpenBSD: patch-src_utils_scripts_mldonkey_importer_pl,v 1.1 2014/01/13 15:01:22 dcoppa Exp $

mldonkey_importer.pl can import an unlimited number of files
(upstream git commit c7667a3e341c2499b0c9a7299f5b05096247556d)

--- src/utils/scripts/mldonkey_importer.pl.orig	Mon Jan 13 15:27:37 2014
+++ src/utils/scripts/mldonkey_importer.pl	Mon Jan 13 15:29:38 2014
@@ -392,13 +392,10 @@ sub convert_gap_format {
 
 sub get_first_free_number {
 	my $n = 1;
-	my $result = 0;
 	
-	while (!$result && !($n>999)) {
-		open(TEST, " <" . $output_folder . sprintf("/%03d.part.met",$n)) or $result=$n;
-		close(TEST);
+	while (-f sprintf("$output_folder/%03d.part.met",$n)) {
 		$n++;
 	}
 	
-	$result;
+	$n;
 }
